<include file="Admin:header" />
 


<table  class="search_table" width="100%" name="index_from" id="index_from">
	<tr>
		<td class="search">



<div id="form_advanced">
			<form action="{:U($module_name.'/index')}" method="post" name="myform1" id="myform1" >
			<input type="hidden" name="g" value="{$Think.GROUP_NAME}" />
			<input type="hidden" name="m" value="{$Think.MODULE_NAME}" />
			<input type="hidden" name="a" class="a" value="{$Think.ACTION_NAME}" />
<input  class="Wdate input-text"  name="startdate" type="text" id="startdate" size="14" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="
<?php 
if($_REQUEST['startdate']){
echo date('Y-m-d',$_REQUEST['startdate']); 
}
?>
" />至
<input  class="Wdate input-text"  name="enddate" type="text" id="enddate" size="14" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="
<?php 
if($_REQUEST['enddate']){
echo date('Y-m-d',$_REQUEST['enddate']); 
}
?>
" />
			<input id="title" type="text" class="input-text" name="keyword" value="<?php echo $_REQUEST['keyword'];?>" />
			<select name="searchtype">
<?php
if(strpos($orderfield,'v4')!==false){
?>
			<option value="saleser" <eq name="searchtype" value="saleser">selected="selected"</eq>>销售员</option>
<?php
}
if(strpos($orderfield,'v5')!==false){
?>
			<option value="country" <eq name="searchtype" value="country">selected="selected"</eq>>网站国家</option>
<?php
}
if(strpos($orderfield,'v6')!==false){
?>
			<option value="domain" <eq name="searchtype" value="domain">selected="selected"</eq>>网站名称</option>

<!--
			<option value="productcode" <eq name="searchtype" value="productcode">selected="selected"</eq>>产品编码</option>
			<option value="username" <eq name="searchtype" value="username">selected="selected"</eq>>客户邮箱</option>
-->

<?php
}
if(strpos($orderfield,'v7')!==false){
?>
			<option value="day" <eq name="searchtype" value="day">selected="selected"</eq>>日销售统计</option>
<?php
}
if(strpos($orderfield,'v8')!==false){
?>
			<option value="month" <eq name="searchtype" value="month">selected="selected"</eq>>月销售统计</option>
<?php
}
?>
			</select>
			<select name="sort" style="display:none;">
				<option value="asc" <if condition="$sort =='asc'">selected="selected"</if>>{:L('order_by_asc')}</option>
				<option value="desc" <if condition="$sort =='desc'">selected="selected"</if>>{:L('order_by_desc')}</option>
			</select>
			<select name="listRows" style="display:none;">
				<option value="100" <if condition="$listRows ==100">selected="selected"</if>>100{:L('listRows')}</option>
				<option value="15" <if condition="$listRows ==5">selected="selected"</if>>15{:L('listRows')}</option>
				<option value="20" <if condition="$listRows ==20">selected="selected"</if>>20{:L('listRows')}</option>
				<option value="30" <if condition="$listRows ==30">selected="selected"</if>>30{:L('listRows')}</option>
				<option value="50" <if condition="$listRows ==50">selected="selected"</if>>50{:L('listRows')}</option>
			</select>
			<input type="hidden" id="menuid" name="menuid" value="{$_GET['menuid']}"/>
			<input type="submit" value="{:L('chaxun')}"  class="button" />
			<input type="reset" value="{:L('reset')}" class="button"  />
<?php
if(strpos($orderfield,'v9')!==false){
?>
			<input type="button" value="打印" class="button" onclick="mo_print()" />
<?php
}
if(strpos($orderfield,'v1')!==false){
?>
			<input type="button" value="客户排行榜" class="button" onclick="mo_top('guest')" />
<?php
}
if(strpos($orderfield,'v2')!==false){
?>
			<input type="button" value="销售员排行榜" class="button" onclick="mo_top('saleser')" />
<?php
}
if(strpos($orderfield,'v3')!==false){
?>
			<input type="button" value="商品排行榜" class="button" onclick="mo_top('goods')" />
<?php
}
?>
			</form>
</div>
		</td>
		
	</tr>
</table>

<form name="myform" id="myform" action="" method="post">
<div class="table-list">
    <table cellspacing="0">
      	<tbody>
<notempty name="saleserarr">
<volist name="saleserarr" id="r">
<tr>
<td style="border-bottom:1px solid #3a6ea5;" colspan=10></td>
</tr>
<tr>
	<th colspan=8 align="center" height="30" style="background:#eef3f7;">{$r.saleser}</th>
</tr>
<tr>       
			<th width="100" align="left">订单号</th> 
            <th width="200" align="left">网站名称</th>
			<th width="200" align="left" >产品描述</th>
			<th width="200" align="left">产品编码</th>
			<th width="80" align="left">单价</th>
			<th width="30" align="left">数量</th>
            <th width="80" align="left">运费</th>
            <th width="80" align="left">总价格</th>
</tr> 
<volist name="r['sublist']" id="r2">
	<volist name="r2['sublist']" id="r3">
	<tr>
	<td>{$r3.sn}</td>
	<td>{$r3.domain}</td> 
	<td colspan="4">
		<foreach name="r3['sublist']" item="rrr" >
		<table>
		<tr>
		<td align="left" width="200">{$rrr.pbody}</td>
		<td align="left" width="200">{$rrr.productcode}</td>
		<td align="left" width="80">{$rrr.price|number_format=###,2} {$r3.currency}</td>
		<td align="left" width="30">{$rrr.num}</td>
		</tr>
		</table>
		</foreach>
	</td>
	<td>{$r3.yunfei|number_format=###,2} {$r3.currency}</td>
	<td>{$r3.price|number_format=###,2} {$r3.currency}</td> 
	</tr>
	</volist>
	<tr style="background:#eef3f7;height:20px;">
		<td colspan=4 align="left">{$r2.domain} 总计</td>
		<td>{$r2.one_price|number_format=###,2} {$r3.currency}</td>
		<td>{$r2.num}</td>
		<td>{$r2.yunfei|number_format=###,2} {$r3.currency}</td>
		<td>{$r2.n_price|number_format=###,2} {$r3.currency}</td>
	</tr>
	<tr>
		<td colspan=10></td>
	</tr>
</volist>
<tr>
	<td colspan=7>合计</td>
	<td>{$r.price|number_format=###,2} USD</td>
</tr>
</volist>
</notempty>

<notempty name="domainarr_c">
		<thead> 
            <tr> 
			<th  colspan=10></th> 
            </tr> 
        </thead> 
<tr>       
			<th width="100" align="left">订单号</th> 
            <th width="200" align="left">网站名称</th>
			<th width="200" align="left" >产品描述</th>
			<th width="200" align="left">产品编码</th>
			<th width="80" align="left">单价</th>
			<th width="30" align="left">数量</th>
            <th width="80" align="left">运费</th>
            <th width="80" align="left">总价格</th>
</tr> 
<volist name="domainarr_c" id="r2">
	<volist name="r2['sublist']" id="r3">
	<tr>
	<td>{$r3.sn}</td>
	<td>{$r3.domain}</td> 
	<td colspan="4">
		<foreach name="r3['sublist']" item="rrr" >
		<table>
		<tr>
		<td align="left" width="200">{$rrr.pbody}</td>
		<td align="left" width="200">{$rrr.productcode}</td>
		<td align="left" width="80">{$rrr.price|number_format=###,2} {$r3.currency}</td>
		<td align="left" width="30">{$rrr.num}</td>
		</tr>
		</table>
		</foreach>
	</td>
	<td>{$r3.yunfei|number_format=###,2} {$r3.currency}</td>
	<td>{$r3.price|number_format=###,2} {$r3.currency}</td> 
	</tr>
	</volist>
	<tr style="background:#eef3f7;height:20px;">
		<td colspan=4 align="left">{$r2.domain} 总计</td>
		<td>{$r2.one_price|number_format=###,2} {$r2.currency}</td>
		<td>{$r2.num}</td>
		<td>{$r2.yunfei|number_format=###,2} {$r2.currency}</td>
		<td>{$r2.n_price|number_format=###,2} {$r2.currency}</td>
	</tr>
	<tr>
		<td colspan=10></td>
	</tr>
</volist>

</notempty>

<notempty name="guest_a">
		<thead> 
			<tr>   
            <th width="150" align="left">客户邮箱</th>
			<th width="120" align="left">订单号</th> 
			<th width="200" align="left" >产品描述</th>
			<th width="80" align="left">总金额</th>
            <th width="80" align="left">合计</th>
		</tr> 
    </thead> 
	<volist name="guest_a" id="r">
	<tr>
	<td>{$r.email}</td>
	<td colspan="3">
	<foreach name="r['sublist']" item="r2" >
		<table>
		<tr>
			<th width="120" align="left">{$r2.sn}</th> 
			<th width="200" align="left" >{$r2.pbody}</th>
			<th width="80" align="left">{$r2.price|number_format=###,2}</th>
		</tr>
		</table>
	</foreach>
	</td>
	<td>{$r.price|number_format=###,2} USD</td> 
	</volist>
</notempty>

<notempty name="saleser_a">
		<thead> 
			<tr>   
            <th width="150" align="left">销售员</th>
			<th width="150" align="left">销售总额</th>
		</tr> 
    </thead> 
	<volist name="saleser_a" id="r">
	<tr>
	<td><a href="{$r.url}">{$r.saleser}</a></td>
	<td>{$r.price|number_format=###,2} USD</td> 
	</volist>
</notempty>

<notempty name="goods_a">
		<thead> 
			<tr>   
            <th width="150" align="left">销售员</th>
			<th width="150" align="left">销售总额</th>
		</tr> 
    </thead> 
	<volist name="saleser_a" id="r">
	<tr>
	<td><a href="{$r.url}">{$r.saleser}</a></td>
	<td>{$r.price|number_format=###,2} USD</td> 
	</volist>
</notempty>


<notempty name="day_c">
		<thead> 
            <tr> 
			<th  colspan=10></th> 
            </tr> 
        </thead> 
<tr>       
			<th width="100" align="left">订单号</th> 
            <th width="200" align="left">网站名称</th>
			<th width="200" align="left" >产品描述</th>
			<th width="200" align="left">产品编码</th>
			<th width="80" align="left">单价</th>
			<th width="30" align="left">数量</th>
            <th width="80" align="left">总价格</th>
</tr> 
<volist name="day_c" id="r">
	<tr>
	<td>{$r.sn}</td>
	<td>{$r.domain}</td> 
	<td colspan="4">
		<foreach name="r['sublist']" item="rrr" >
		<table>
		<tr>
		<td align="left" width="200">{$rrr.pbody}</td>
		<td align="left" width="200">{$rrr.productcode}</td>
		<td align="left" width="80">{$rrr.price|number_format=###,2} {$r.currency}</td>
		<td align="left" width="30">{$rrr.num}</td>
		</tr>
		</table>
		</foreach>
	</td>
	<td>{$r.price|number_format=###,2} {$r.currency}</td> 
	</tr>
</volist>
<tr>
	<td colspan=6>合计</td>
	<td>{$price|number_format=###,2} USD</td>
</tr>

</notempty>



<notempty name="pro_code_">
		<thead> 
            <tr> 
			<th  colspan=10></th> 
            </tr> 
        </thead> 
<tr>       
			<th width="200" align="left">产品编码</th>
			<th width="80" align="left">国家</th>
			<th width="80" align="left">数量</th>
            <th width="80" align="left">合计</th>
</tr> 
<volist name="pro_code_" id="r_a">
<tr>
	<td>{$r_a.pro_code}</td>
	<td colspan="2">
		<foreach name="r_a.country" item="rrr" >
		<table>
		<tr>
			<td align="left" width="80">{$rrr.country}</td>
			<td align="left" width="80">{$rrr.num}</td>
		</tr>
		</table>
		</foreach>
	</td>
	<td>{$r_a.t_num}</td> 
</tr>
</volist>
</notempty>

      	</tbody>
    </table>


</form></div>    

<div id="pages" class="page  print_hide">{$page}</div>
<script>
$("#catid").attr("value",'{$catid}');
function confirm_deleteall(){
	art.dialog.confirm("{:L('real_delete')}", function(){ $('#myform').submit();});
}
function mo_print(){
		window.open(location.href+'&pdf=1','Print_Window','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no,status=no');
}

function mo_bill() 
{ 
var   previewWindow;    
if(previewWindow   ==   null){    
      previewWindow   =   window.open("{:U($module_name.'/bill')}",'myWin','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no,status=no'); 
}else   if(previewWindow.closed   ==   true){    
      previewWindow   =   window.open("{:U($module_name.'/bill')}",'myWin','height='+ new String(screen.availHeight-28) + ',top=0,left=0,width=' + new String(screen.availWidth-10) + ',location=no,menubar=no,scrollbars=yes,resizable=no,toolbar=no,status=no'); 
}    
myform.target   =   previewWindow.name;    
myform.action   =   "{:U($module_name.'/bill')}"
myform.submit();    
previewWindow.focus();    
}

function mo_top(i){
myform1.action   =   "{:U($module_name.'/index')}&top="+i;
myform1.submit(); 
}

$(document).ready(function(){
	if(self==top){
		$('.tophide').hide();
	}
})
var isshow=Array();
function showsublist(index){
	if(isshow[index]){
		isshow[index]=false;
	}else{
		isshow[index]=true;
	}
	if(isshow[index]){
		$('#mo_'+index).show();
	}else{
		$('#mo_'+index).hide();
	}
}
</script>